﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 泛型
{
    enum MyEnum
    {

    }
    class GeneriArrayClass<T>
    {
        private T[] _array; //字段

        public GeneriArrayClass(int size)
        {
            _array = new T[size];
        }

        //设置元素内容
        public void setItem(int index,T value)
        {
            _array[index] = value;
        }
        
        public T getItem(int index)
        {
            return _array[index];
        }

        public void Swap<T>(ref T t1,ref T t2)
        {
            T temp = t1;
            t1 = t2;
            t2 = temp;
        }
        
        public void Sort()
        {
            for (int i = 0; i < _array.Length; i++)
            {
                for (int j = 0; j < i-1; j++)
                {
                    //if (_array[i] > _array[j])
                    //    Swap<T>(_array[i].array[j]);
                }
            }
        }
    }
}
